<style>
	.red{ color:red; }
</style>
<input type="hidden" id="increaseType" th:value="${increaseType}"/>
<div class="row-content am-cf">
	<div class="row">
		<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
			<div class="widget am-cf">
				<div class="widget-head am-cf" th:switch="${type}">
					<button type="button" th:case="preAudit" onclick="menuLoad('credit/preAuditUI',this)" class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
					<button type="button" th:case="audited" onclick="menuLoad('credit/auditedUI',this)" class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
				</div>
				<div th:each="limit,iterStat : ${limitList}">
					<div class="widget-head am-cf">
						<div class="widget-title  am-cf">
							<span th:if="${limit.type} == 'decrease' ">减额申请</span><span th:if="${limit.type} == 'increase' ">提额申请</span><span th:text="${iterStat.index +1 }"></span>
						</div>
					</div>
						<div th:if="${limit.status} != 'apply' ">
							<ol class="am-breadcrumb">
								<li><a href="#">审批结果</a></li>
							</ol>
							<table class="am-table am-table-bordered">
								<tbody>
									<tr>
										<td class="am-primary">审批决议:</td>
										<td th:text="${limit.statusDesc}"></td>
										<td class="am-primary"><div th:if="${limit.type} == 'decrease' ">审批减额金额：</div><div th:if="${limit.type} == 'increase' ">审批提额金额：</div></td>
										<td th:text="${limit.pass_amount}+'元'"></td>
										<td class="am-primary">审批时间：</td>
										<td th:text="${limit.auditor_time}"></td>
										<td class="am-primary">决议人：</td>
										<td th:text="${limit.cur_auditor_name}"></td>
									</tr>
									<tr th:if="${limit.remark} != '' and  ${limit.remark} != 'ok' ">
										<td class="am-primary">驳回原因:</td>
										<td colspan="7" th:text="${limit.remark}"></td>
									</tr>
								</tbody>
							</table>
						</div>
						<ol class="am-breadcrumb">
							<li><a href="#"><div th:if="${limit.type} == 'decrease' ">降额申请详情</div><div th:if="${limit.type} == 'increase' ">提额申请详情</div></a></li>
						</ol>
						<table class="am-table am-table-bordered">
							<tbody>
								<tr>
									<td class="am-primary" ><div th:if="${limit.type} == 'decrease' ">申请降额：</div><div th:if="${limit.type} == 'increase' ">申请提额：</div></td>
									<td colspan="2" th:text="${limit.apply_amount}+'元'"></td>
									<td class="am-primary">申请时间：</td>
									<td colspan="2" th:text="${limit.apply_time}"></td>
								</tr>
							</tbody>
						</table>
				</div>
				
				<!-- 授信申请详情 -->
				<div class="widget-head am-cf">
					<div class="widget-title  am-cf">授信申请</div>
				</div>
				<div th:if="${not #lists.isEmpty(auditResult)}">
					<ol class="am-breadcrumb">
						<li><a href="#">审批结果</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary">审批决议:</td>
								<td th:text="${auditResult.isPass}">王小二</td>
								<td class="am-primary">审批授信金额：</td>
								<td th:text="${auditResult.realCredit}"></td>
								<td class="am-primary">审批时间：</td>
								<td th:text="${auditResult.auditTime}"></td>
								<td class="am-primary">决议人：</td>
								<td th:text="${auditResult.auditName}"></td>
							</tr>
							<tr th:if="${auditResult.reason} != '' and  ${auditResult.reason} != 'ok' ">
								<td class="am-primary">驳回原因:</td>
								<td colspan="7" th:text="${auditResult.reason}"></td>
							</tr>

						</tbody>
					</table>
				</div>
				<ol class="am-breadcrumb">
					<li><a href="#">授信申请详情</a></li>
				</ol>
				<table class="am-table am-table-bordered">
					<tbody>
						<tr>
							<td class="am-primary">申请授信额：</td>
							<td colspan="3" th:text="${sxDetail.credit}"></td>
							<td class="am-primary">申请时间：</td>
							<td th:text="${sxDetail.createTime}"></td>
						</tr>
						<tr th:each="product : ${productList}">
							<td class="am-primary">产品类型：</td>
							<td th:text="${product.product_name}"></td>
							<td class="am-primary">还款方式：</td>
							<td th:text="${product.payTypeDesc}"></td>
							<td class="am-primary">额度占比：</td>
							<td th:text="${product.lendRateStr}"></td>
						</tr>
						<tr>
							<td class="am-primary">合伙人等级：</td>
							<td th:text="${sxDetail.agentGrade}"></td>
							<td class="am-primary">合伙人姓名：</td>
							<td th:text="${sxDetail.agentName}">王</td>
							<td class="am-primary">合伙人手机号：</td>
							<td th:text="${sxDetail.agentMobile}"></td>
						</tr>

					</tbody>
				</table>
				<ol class="am-breadcrumb">
						<li><a href="#">审批详情</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary">审批流程</td>
								<td colspan="5" th:text="${flowsDesc}"></td>
							</tr>
							<tr th:each="flow : ${auditFlowList}">
								<td class="am-primary" th:text="${flow.gradeName}">镇级代理审批人</td>
								<td th:text="${flow.agentName}">王小二</td>
								<td class="am-primary">审批人电话</td>
								<td th:text="${flow.agentMobile}">15005054695</td>
								<td class="am-primary">审批时间</td>
								<td th:text="${flow.auditTime}">2012-10-01</td>
							</tr>
						</tbody>
					</table>
					<ol class="am-breadcrumb">
						<li><a href="#">用户信息详情</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary">客户姓名</td>
								<td th:text="${sxDetail.jkName}"></td>
								<td class="am-primary">客户身份证</td>
								<td th:text="${sxDetail.jkIdcard}"></td>
								<td class="am-primary">客户性别</td>
								<td th:text="${sxDetail.jkSex}"></td>
							</tr>
							<tr>
								<td class="am-primary">客户手机号</td>
								<td th:text="${sxDetail.jkMobile}"></td>
								<td class="am-primary">客户家庭地址</td>
								<td colspan="3"  th:text="${sxDetail.jkAddress}"></td>
							</tr>
						</tbody>
					</table>
					<ol class="am-breadcrumb">
						<li><a href="#">配偶信息</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary">配偶姓名</td>
								<td th:text="${sxDetail.spouseName}"></td>
								<td class="am-primary">配偶身份证</td>
								<td th:text="${sxDetail.spouseCardId}"></td>
								<td class="am-primary">手机号</td>
								<td th:text="${sxDetail.spouseMobile}"></td>
								<td class="am-primary">婚姻证明</td>
								<td >
									<a href="javascript:void(0)" th:onclick="'javascript:check(\''+${sxDetail.spouseMarriagePic}+'\')' ">查看</a>
								</td>
							</tr>
						</tbody>
					</table>
					<ol class="am-breadcrumb">
						<li><a href="#">户口簿信息</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary">户主登记卡</td>
								<td >
							 		<a href="javascript:void(0)" th:onclick="'javascript:check(\''+${sxDetail.homeHostPic}+'\')' ">查看</a>
								</td>
								<td class="am-primary">借款人登记卡</td>
								<td >
							 		<a href="javascript:void(0)" th:onclick="'javascript:check(\''+${sxDetail.homeLoanPic}+'\')' ">查看</a>
								</td>
								<td class="am-primary">借款人配偶登记卡</td>
								<td >
								 <a href="javascript:void(0)" th:onclick="'javascript:check(\''+${sxDetail.homeSpousePic}+'\')' ">查看</a>
								</td>
							</tr>
						</tbody>
					</table>
					<ol class="am-breadcrumb">
						<li><a href="#">房产/宅基地证明</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary">权利人页</td>
								<td class="am-primary">附记页</td>
								<td class="am-primary">抵押合同条款页</td>
								<td class="am-primary">抵押合同签名页</td>
								<td class="am-primary">提交时间</td>
							</tr>
							<tr>
								<td>
									<span th:if="${houseMap['house_qlr']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${houseMap['house_qlr']}+'\')' ">查看</a></span>
									<span th:if="${houseMap['house_qlr']} == null">无</span>
								</td>
								<td>
									<span th:if="${houseMap['house_fj']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${houseMap['house_fj']}+'\')' ">查看</a></span>
									<span th:if="${houseMap['house_fj']} == null">无</span>
								</td>
								<td>
									<span th:if="${houseMap['house_tk']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${houseMap['house_tk']}+'\')' ">查看</a></span>
									<span th:if="${houseMap['house_tk']} == null">无</span>
								</td>
								<td>
									<span th:if="${houseMap['house_qm']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${houseMap['house_qm']}+'\')' ">查看</a></span>
									<span th:if="${houseMap['house_qm']} == null">无</span>
								</td>
								<td><span th:text="${houseMap['create_time']}"></span></td>
							</tr>
						</tbody>
					</table>
					<ol class="am-breadcrumb">
						<li><a href="#">土地承包经营权证明</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary" colspan="7">土地承包经营权证</td>
							</tr>
							<tr>
								<td class="am-primary">土地面积（亩）</td>
								<td class="am-primary">主要作物</td>
								<td class="am-primary">承包经营权证登记页</td>
								<td class="am-primary">地块情况页</td>
								<td class="am-primary">抵押合同条款页</td>
								<td class="am-primary">抵押合同签名页</td>
								<td class="am-primary">提交时间</td>
							</tr>
							<tr>
								<td th:text="${tudiMap['tudiArea']}"></td>
								<td th:text="${tudiMap['crop']}" ></td>
								<td>
									<span th:if="${tudiMap['tudi_dj']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_dj']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_dj']} == null">无</span>
								</td>
								<td>
									<span th:if="${tudiMap['tudi_qk']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_qk']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_qk']} == null">无</span>
								</td>
								<td>
									<span th:if="${tudiMap['tudi_tk']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_tk']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_tk']} == null">无</span>
								</td>
								<td>
									<span th:if="${tudiMap['tudi_qm']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_qm']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_qm']} == null">无</span>
								</td>
								<td><span th:text="${tudiMap['create_time']}"></span></td>
							</tr>
							<tr>
								<td class="am-primary" colspan="7">民间土地承包合同</td>
							</tr>
							<tr>
								<td class="am-primary">土地面积（亩）</td>
								<td class="am-primary">主要作物</td>
								<td class="am-primary">承包经营权证登记页</td>
								<td class="am-primary">地块情况页</td>
								<td class="am-primary">抵押合同条款页</td>
								<td class="am-primary">抵押合同签名页</td>
								<td class="am-primary">提交时间</td>
							</tr>
							<tr>
								<td th:text="${tudiMap['tudiArea']}"></td>
								<td th:text="${tudiMap['crop']}" ></td>
								<td>
									<span th:if="${tudiMap['tudi_ht_dj']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_ht_dj']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_ht_dj']} == null">无</span>
								</td>
								<td>
									<span th:if="${tudiMap['tudi_ht_qk']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_ht_qk']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_ht_qk']} == null">无</span>
								</td>
								<td>
									<span th:if="${tudiMap['tudi_ht_tk']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_ht_tk']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_ht_tk']} == null">无</span>
								</td>
								<td>
									<span th:if="${tudiMap['tudi_ht_qm']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${tudiMap['tudi_ht_qm']}+'\')' ">查看</a></span>
									<span th:if="${tudiMap['tudi_ht_qm']} == null">无</span>
								</td>
								<td><span th:text="${tudiMap['create_time']}"></span></td>
							</tr>
						</tbody>
					</table>
					<ol class="am-breadcrumb">
						<li><a href="#">车产证明</a></li>
					</ol>
					<table class="am-table am-table-bordered">
						<tbody>
							<tr>
								<td class="am-primary">登记信息栏以及摘要栏</td>
								<td class="am-primary">登记栏最后一页</td>
								<td class="am-primary">抵押合同条款页</td>
								<td class="am-primary">抵押合同签名页</td>
								<td class="am-primary">提交时间</td>
							</tr>
							<tr>
								<td>
									<span th:if="${carMap['car_dj']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${carMap['car_dj']}+'\')' ">查看</a></span>
									<span th:if="${carMap['car_dj']} == null">无</span>
								</td>
								<td>
									<span th:if="${carMap['car_djzh']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${carMap['car_djzh']}+'\')' ">查看</a></span>
									<span th:if="${carMap['car_djzh']} == null">无</span>
								</td>
								<td>
									<span th:if="${carMap['car_tk']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${carMap['car_tk']}+'\')' ">查看</a></span>
									<span th:if="${carMap['car_tk']} == null">无</span>
								</td>
								<td>
									<span th:if="${carMap['car_qm']}  != null"><a href="javascript:void(0)" th:onclick="'javascript:check(\''+${carMap['car_qm']}+'\')' ">查看</a></span>
									<span th:if="${carMap['car_qm']} == null">无</span>
								</td>
								<td><span th:text="${carMap['create_time']}"></span></td>
							</tr>
						</tbody>
					</table>
					<ol class="am-breadcrumb">
						<li><a href="#">用户信用评级</a></li>
					</ol>
					<ol class="am-breadcrumb">
						<li th:text="'综合得分：'+${score}"></li>
						<li th:text="'信用评级：'+${rating}"></li>
						<li th:text="${ratingDesc}"></li>
					</ol>
					<table class="am-table am-table-bordered am-table-centered">
						<thead>
							<tr>
								<th colspan="1" class="am-primary">信用指标</th>
								<th colspan="4" class="am-primary">评级标准</th>

							</tr>
						</thead>
						<tbody th:each="answer : ${answerList}">
							<tr>
								<td th:text="${answer.quesetName}">家庭年龄</td>
								<td colspan="4" th:text="${answer.answerName}"></td>
							</tr>
						</tbody>
					</table>
					<!-- 借款信息 -->
					<div th:if="${not #lists.isEmpty(loanInfo)}">
						<div class="widget-head am-cf">
							<div class="widget-title  am-cf">借款信息 </div>
						</div>
						<table class="am-table am-table-bordered" >
					   <thead>
					   		<tr>
					   			<th>借款待还本息</th>
					   			<th>逾期金额</th>			   			
					   			<th>逾期借款笔数</th>			   			
					   			<th>结清笔数</th>			   			
					   			<th>结清金额</th>			   			
					   		</tr>
					   </thead>
					   <tbody>
						   		<tr>
						   			<td th:text="${loanInfo.dhbx}"></td>
						   			<td th:text="${loanInfo.yqje}"></td>
						   			<td th:text="${loanInfo.yqbs}"></td>
						   			<td th:text="${loanInfo.jqbs}"></td>
						   			<td th:text="${loanInfo.jqje}"></td>
						   		</tr>
					   </tbody>
					</table>
				</div>
					
					<!-- 百融 -->
					<div th:if="${not #lists.isEmpty(riskInfo)}">
						<div class="widget-head am-cf">
							<div class="widget-title  am-cf"> 百融反欺诈信息 </div>
						</div>
						<table class="am-table am-table-bordered" >
					   <thead>
					   		<tr>
					   			<th>类型</th>
					   			<th>危险内容</th>			   			
					   		</tr>
					   </thead>
					   <tbody>
						   	<th:block th:each="data,index1 : ${riskInfo}">
						   		<tr th:each="item,index : ${data.info}">
						   			<td th:if="${index.index==0}" th:text="${data.type_name}" th:rowspan="${#lists.size(data.info)}"></td>
						   			<td th:text="${item.info}" th:classappend="${item.color}"></td>
						   		</tr>
						   	</th:block>
					   </tbody>
					</table>
				</div>
			</div>
		</div>
		<div class="am-u-sm-9 am-u-sm-push-2" th:if="${type}== 'preAudit'">
			<button type="button" onclick="bindPrompt('false')" shiro:hasPermission="SXTESP_TESP_BH" class="am-btn am-btn-primary tpl-btn-bg-color-success ">驳回</button>
			<button type="button" onclick="bindPrompt('true')" shiro:hasPermission="SXTESP_TESP_TG" class="am-btn am-btn-success tpl-btn-bg-color-success ">通过</button>
		</div>
	</div>
</div>
<!-- 图片弹出框 -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
	<div class="am-modal-dialog">
		<div class="am-modal-hd">
			<a href="javascript: void(0)" class="am-close am-close-spin"
				data-am-modal-close="data-am-modal-close">&times;</a>
		</div>
		<div class="am-modal-bd">
			<img class="am-radius" src="" id="imgId" />
		</div>
	</div>
</div>
<!-- 审核弹出框 -->
<form id="myForm" method="post">
	<div class="am-modal am-modal-prompt" tabindex="-1" id="my-prompt">
		<div class="am-modal-dialog">
			<input type="hidden" id="sxId" th:value="${sxId}" name="realCredit" />
			<input type="hidden" id="incId" th:value="${incId}" name="incId" />
			<input type="hidden" id="isPass" name="isPass" />
			<div class="am-modal-hd" id="title">提额授信审批</div>
			<div class="am-modal-bd">
				<span id="msg" style="display:none;color:red"></span>
				<div class="am-modal-bd" id="passDiv">
					<table>
						<tr>
							<td class="am-primary">客户名称：</td>
							<td th:text="${sxDetail.jkName}"></td>
						</tr>
						<tr>
							<td class="am-primary">客户身份证：</td>
							<td th:text="${sxDetail.jkIdcard}"></td>
						</tr>
						<tr>
							<td class="am-primary">已授信额度：</td>
							<td th:text="${originCredit}" id="userCredit"></td>
						</tr>
						<tr>
							<td class="am-primary">产品额度占比：</td>
							<td th:each="product : ${productList}">
								<span th:text="${product.product_name} + ${product.lendRateStr}"></span>
							</td>
						</tr>
						<tr>
							<td class="am-primary"><span class="creditIncreaseId">审批提额金额：</span></td>
							<td><input type="text" class="am-modal-prompt-input" name="passAmount" id="passAmount" th:value="${applyAmount}" /></td>
						</tr>
					</table>
				</div>
				<div class="am-modal-bd" id="noPassDiv">
					<textarea rows="3" cols="50" placeholder="输入驳回原因，不超过30个字；" id="remark" name="remark"></textarea>
				</div>
			</div>
			<div class="am-modal-footer">
				<span class="am-modal-btn" data-am-modal-cancel="">取消</span> <span
					class="am-modal-btn" data-am-modal-confirm="">提交</span>
			</div>
		</div>
	</div>
</form>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1" >
  <div class="am-modal-dialog">
   <div class="am-modal-hd">
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="data-am-modal-close">&times;</a>
    </div>
 	<div class="am-modal-bd" >
		<img class="am-radius" src="" id="imgId"/>
    </div>
  </div>
</div>

<script type="text/javascript"
	th:src="@{/customer/credit/auditDetail.js}" />
<script>
   function returnBack(){
	   window.history.back();
   }
   
   function check(pic){
		$("#imgId").attr('src',pic); 
		$('#doc-modal-1').modal();
	}
   
</script>
